Enums and DTOs
Enums
NotificationCycleType
Defines the cycle stage for sending rating notifications.
| Value | Description |
|---|---|
initial | The first notification sent. |
reminder1 | First reminder after the initial notification if no rating was done. |
reminder2 | Second reminder if no rating to raminder1 notifications. |
NotificationStatus
Represents the current status of a rating notification.
| Value | Description |
|---|---|
opn | Notification is open and awaiting action. |
rtd | Rating has been completed by the patient. |
cxl | Notification has been cancelled (When patient doesn't rate past 7 days post initial notification). |
DTOs
ApproveRatingDto
Used for approving or rejecting a single rating.
| Property | Type | Description |
|---|---|---|
agent_id | number | ID of the agent performing the action. |
booking_id | string | Booking ID whose rating is being evaluated. |
status | 'approve' | 'reject' | Status to approve or reject rating. |
BookingStatusDto
Used to represent the status (approve/reject) of a booking.
| Property | Type | Description |
|---|---|---|
booking_id | string | ID of the booking. |
status | 'approve' | 'reject' | Status to apply to the booking. |
MultipleApproveRatingDto
Used for approving or rejecting ratings for multiple bookings by an agent.
| Property | Type | Description |
|---|---|---|
agent_id | number | ID of the agent performing the approvals. |
ratings | BookingStatusDto[] | List of bookings with their respective approval statuses. |
CreateRatingDto
Used when a patient submits a rating for a completed booking.
| Property | Type | Description |
|---|---|---|
patient_id | number | ID of the patient submitting the rating. |
booking_id | string | Booking ID of appoinment being rated. This is emrAppointmentId for external appoinments. |
overall_rating | number (1.0 to 5.0) | Overall experience rating. Must be between 1.0 and 5.0 (max 1 decimal place). |
provider_rating | number (1.0 to 5.0) | Rating for the service provider. Must be between 1.0 and 5.0. |
staff_rating | number (1.0 to 5.0) | Rating for staff performance. Must be between 1.0 and 5.0. |
clinic_rating | number (1.0 to 5.0) | Rating for the clinic/facility. Must be between 1.0 and 5.0. |
comments | string (optional) | Additional comments from the patient. |
tags | string (optional) | Keywords or tags related to the rating. |
status | 'pending' | 'approved' | 'rejected' (optional) | Status of the rating entry (defaults to 'pending'). |
GetProviderRatingsDto
Used to query provider ratings with optional filters.
| Property | Type | Description |
|---|---|---|
limit | number (optional) | Maximum number of rating results to return. Defaults to 1. |
includeComments | boolean (optional) | Whether to include patient comments in the rating results. |
deepStats | boolean (optional) | Whether to include deep statistical insights in the result. Accepts boolean values, even as strings (e.g., 'true', 'false'). |
NotificationDto
Represents the payload used when sending a notification related to an appointment. This is the format appointment completed status sync returns, used to trigger notifications.
| Property | Type | Description |
|---|---|---|
appointmentId | number | The ID of the appointment associated with the notification. |
isInternal | boolean | Indicates whether the notification is internal (true) or external (false). |
RatingAppointmentDto
Represents the structure of a single detailed rating returned in responses.
| Property | Type | Description |
|---|---|---|
id | number | Unique ID of the rating. |
overallRating | number | Overall score given by the patient. |
providerRating | number | Rating specific to the provider. |
staffRating | number | Rating of the staff involved. |
clinicRating | number | Rating of the clinic/facility. |
comments | string | null | Optional comment provided by the patient. |
status | string | Rating status: 'pending', 'approved', or 'rejected'. |
datetimeRated | Date | Timestamp when the rating was submitted. |
patient | patientDto | The patient who submitted the rating. |
appointment | AppointmentDto | The appointment associated with the rating. |
businessLocation | BusinessLocationDto | The business location where the appointment took place. |
agent | AgentDto | The provider/agent associated with the appointment. |
AppointmentDto
Represents the basic details of an appointment tied to a rating.
| Property | Type | Description |
|---|---|---|
bookingId | string | Unique identifier of the booking. |
startDatetime | Date | Date and time when the appointment starts. |
PaginationMetaDto
Describes pagination metadata for paginated responses.
| Property | Type | Description |
|---|---|---|
total | number | Total number of records. |
page | number | Current page number. |
limit | number | Number of records per page. |
totalPages | number | Total number of available pages. |
UnapprovedRatingsResponseDto
Returns a paginated list of unapproved ratings.
| Property | Type | Description |
|---|---|---|
data | RatingAppointmentDto[] | Array of unapproved rating records. |
pagination | PaginationMetaDto | Metadata for the current page result. |
RatingComments
Represents a single rating comment with associated metadata.
| Property | Type | Description |
|---|---|---|
comment | string | Textual feedback provided by the patient. |
rating | number | Rating score for this particular comment. |
datetime_rated | Date | Date and time the rating was submitted. |
patient | object | Basic info about the patient (first and last name). |
patient.firstName | string | patient's first name. |
patient.lastName | string | patient's last name. |
DeepStats
Provides a breakdown of how many ratings fell into each star category.
| Property | Type | Description |
|---|---|---|
total5Star | number | Total number of 5-star ratings. |
total4Star | number | Total number of 4-star ratings. |
total3Star | number | Total number of 3-star ratings. |
total2Star | number | Total number of 2-star ratings. |
total1Star | number | Total number of 1-star ratings. |
ProviderRatingsDto
Represents summarized rating data for a specific provider (agent), optionally including comments and rating breakdown.
| Property | Type | Description |
|---|---|---|
agentId | number | The unique identifier of the agent. |
averageRating | number | Average rating score, rounded to one decimal place. |
overallCount | number | Total number of ratings submitted for this agent. |
comments | RatingComments[] | undefined | Optional list of patient comments. |
deepStats | DeepStats | undefined | Optional breakdown of rating distribution. |